package com.ymatou.iapi.godmch.service;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ymatou.iapi.godmch.parameter.MchInfoVo;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*商户信息(批量)Call
*FreeMaker Template自动生成代码
*/
public class listbyidmchCall extends YmatouBaseCall{
	private static String opurl ="api/mch/listbyid";
	
	public listbyidmchCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<MchInfoVo> getResult() {
		List<MchInfoVo> result =new ArrayList<MchInfoVo>();
		try {
			result = (List<MchInfoVo>) new Gson().fromJson(getJsonObject().get("result").getAsJsonObject().get("mchList").toString(), new TypeToken<List<MchInfoVo>>() {}.getType());
		} catch (Exception e) {
//			e.printStackTrace();
		}
		return result;
	}
}